<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>事件代理</title>
</head>

<body>
  <div id="father">
    <a href="#">链接1号</a>
    <a href="#">链接2号</a>
    <a href="#">链接3号</a>
    <a href="#">链接4号</a>
    <a href="#">链接5号</a>
    <a href="#">链接6号</a>
  </div>
  <script>
    const div = document.getElementById('father')
    div.addEventListener('click', (e) => {
      if (e.target.tagName === 'A') {
        e.preventDefault()
        console.log('我是', e.target.innerText)
      }
    })
  </script>
</body>

</html>